Skip to content

rename to file, isKit, directory#999

Merged
jycouet merged 11 commits intomainfrom
refactor/files-to-file
Mar 28, 2026
Merged

rename to file, isKit, directory#999
jycouet merged 11 commits intomainfrom
refactor/files-to-file

Conversation

@jycouet
Copy link
Copy Markdown
Contributor

@jycouet jycouet commented Mar 21, 2026

Singular form — file.viteConfig reads better than files.viteConfig since each property refers to a single file path.

Pure mechanical rename, no logic changes.

Prep for community add-on improvements.


I'm thinking also to switch:

/** If we are in a kit project, this object will contain the lib and routes directories */
kit: { libDirectory: string; routesDirectory: string } | undefined;

to

isKit: boolean
directory: {
  lib: string,
  routes: string
}

So that directory has good default in non-kit as well!

Singular form is more consistent — `file.viteConfig` reads better
than `files.viteConfig` since each property refers to a single file.

Prep for community add-on improvements.
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 21, 2026

🦋 Changeset detected

Latest commit: 5fdc1b4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
sv Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 21, 2026

Open in StackBlitz

npx https://pkg.pr.new/svelte-migrate@999
npx https://pkg.pr.new/sv@999
npx https://pkg.pr.new/@sveltejs/sv-utils@999

commit: 5fdc1b4

@jycouet jycouet mentioned this pull request Mar 21, 2026
12 tasks
@jycouet jycouet changed the title rename workspace files to file rename to file, isKit, directory Mar 21, 2026
Copy link
Copy Markdown
Member

@manuel3108 manuel3108 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fully agree with file, totally makes snese.

But having directory.routes in a non kit project is irritating for me. But I do agree that is isKit makes more sense than checking kit against undefined. Undecided and without better ideas on this one.

Feel free to do with this whatever you want :D

@jycouet
Copy link
Copy Markdown
Contributor Author

jycouet commented Mar 27, 2026

But having directory.routes in a non kit project is irritating for me.

Me too :D But it was "simple". Maybe I should have just added a "good" JSDoc on top.
Instead I tried with another thing: kitRoutes to be more explicite. (with a fallback even in non kit... to not fail silently. I tried with type narrowing, but since we destructure everything... it doesn't work)

WDYT like this? I'm hesitant with this or just routes with JSDocs.
I'll wait to merge :D

Copy link
Copy Markdown
Member

@manuel3108 manuel3108 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from my very minor comment, looks good!

@jycouet jycouet merged commit c0a5c82 into main Mar 28, 2026
8 checks passed
@jycouet jycouet deleted the refactor/files-to-file branch March 28, 2026 21:20
@github-actions github-actions bot mentioned this pull request Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants